package cn.ityao.es.config;

/**
 * hpc-cloud >>> 【com.cloud.common.ip】
 *
 * @author: tongyao
 * @since: 2025-07-31 09:25
 */

import com.maxmind.db.Reader;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import java.io.File;
import java.io.IOException;

@Configuration
public class GeoIPConfig {

    @Bean
    public Reader cityReader() throws IOException {
        return new Reader(new File("C:\\Users\\zhangtongyao\\Desktop\\ip\\offline-ip-library\\GeoLite2-City.mmdb"));
    }

    @Bean
    public Reader asnReader() throws IOException {
        return new Reader(new File("C:\\Users\\zhangtongyao\\Desktop\\ip\\offline-ip-library\\GeoLite2-ASN.mmdb"));
    }

    @Bean
    public Reader cnReader() throws IOException {
        return new Reader(new File("C:\\Users\\zhangtongyao\\Desktop\\ip\\offline-ip-library\\GeoCN.mmdb"));
    }
}
